package com.huike.controller;

import com.huike.core.controller.BaseController;
import com.huike.dto.BusinessDto;
import com.huike.dto.ClueDto;
import com.huike.result.MyPageResult;
import com.huike.result.PageResult;
import com.huike.service.BusinessPoolService;
import com.huike.service.CluePoolService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/business")
@Slf4j
public class BusinessPoolController extends BaseController {

    @Autowired
    private BusinessPoolService businessPoolService;

    /**
     * 分页查询公海
     * @param businessDto
     * @return
     */
    @GetMapping("/pool")
    public MyPageResult getBusinessPoolListPage(BusinessDto businessDto ) {
        log.info("分页查询公海，{}",businessDto);
        PageResult businessPoolListPage = businessPoolService.getBusinessPoolListPage(businessDto);
        return MyPageResult.ok(businessPoolListPage.getRecords(),businessPoolListPage.getTotal());
    }

}
